package com.ruige.account.util;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;

public class CookieUtils {

    public static Cookie getCookieByName(HttpServletRequest request, String authorization) {
        Cookie[] cookies = request.getCookies();
        for (Cookie cookie : cookies) {
            if (authorization.equals(cookie.getName())) {
                return cookie;
            }
        }
        return null;
    }
}
